<template>
    <div>
    <el-container style="height: 840px; border: 1px solid #eee">
      <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
        <el-menu :default-openeds="['1']" :router=true>
            <el-menu-item index="/check"><a class="el-icon-view">查看所有用户</a></el-menu-item>
            <el-menu-item index="/approval"><a class="el-icon-s-order">审批申请</a></el-menu-item>
        </el-menu>
      </el-aside>

      <el-container>
        <el-header style="text-align: right; font-size: 12px">
          <el-button type="primary" icon="el-icon-d-arrow-left" plain v-on:click="returnMain()">返回</el-button>
        </el-header>

        <el-main>
          <router-view/>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
    name:"Aministrator",
    data(){
        return{
            activeIndex: '',
        }
    },
    methods:{
        returnMain(){
          this.$router.push("/mainTable");
      }
    },

    created(){
        var userString = localStorage.getItem("user");
        this.user = JSON.parse(userString);
            if (userString&&this.user.userKind=='管理员') {
                this.user = JSON.parse(userString);
            } else {
                alert("您没有权限");
                location.href = "#/mainTable";
            }
        this.$router.push("/check");
    }
}
</script>

<style>
    .el-header {
    background-color: #b3c0d1;
    color: #333;
    line-height: 60px;
    }

    .el-aside {
    color: #333;
    }
</style>